home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs-1.000 / xemacs-19.14_with_offix_dnd.diff
Encoding:
Text File  |  1996-06-26  |  11.2 KB  |  378 lines

  1. diff -u --recursive orig/xemacs-19.14/INSTALL xemacs-19.14/INSTALL
  2. --- orig/xemacs-19.14/INSTALL    Wed Jun 26 17:42:35 1996
  3. +++ xemacs-19.14/INSTALL    Wed Jun 26 17:48:08 1996
  4. @@ -212,6 +212,10 @@
  5.  drop support.  `configure' will attempt to detect this option and
  6.  define `--with-cde' for you.
  7.  
  8. +The `--with-offix option allows you to enable or disable OffiX drag and
  9. +drop support.  `configure' will attempt to detect this option and
  10. +define `--with-offix' for you.
  11. +
  12.  The `--with-energize' option specifies that XEmacs should be built
  13.  with support for the Lucid Energize system.  (If you have not
  14.  purchased Energize, specifying this option won't gain you anything.)
  15. diff -u --recursive orig/xemacs-19.14/configure xemacs-19.14/configure
  16. --- orig/xemacs-19.14/configure    Wed Jun 26 18:48:40 1996
  17. +++ xemacs-19.14/configure    Wed Jun 26 18:48:19 1996
  18. @@ -211,6 +211,7 @@
  19.               Motif dialog boxes will be used if Motif can be
  20.               found.)
  21.  --with-cde (*)        Compile in support for CDE drag and drop.
  22. +--with-offix (*)    Compile in support for OffiX drag and drop.
  23.  --with-xpm (*)        Compile with support for XPM files.
  24.              It is highly recommended that you obtain XPM
  25.              (version 3.4g or better) if you don't already
  26. @@ -625,6 +626,22 @@
  27.            eval "${opt}=\"${val}\""
  28.          ;;
  29.  
  30. +        ## Has the user requested OffiX support?
  31. +    "with_offix" )
  32. +      ## Make sure the value given was either "yes" or "no".
  33. +      case "${val}" in
  34. +        y | ye | yes )    val=yes ;;
  35. +        n | no )        val=no  ;;
  36. +        * )
  37. +          (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  38. +Set it to either \`yes' or \`no'."
  39. +           echo "${short_usage}") >&2
  40. +          exit 1
  41. +        ;;
  42. +      esac
  43. +          eval "${opt}=\"${val}\""
  44. +        ;;
  45. +
  46.          ## Has the user requested XPM support?
  47.      "with_xpm" )
  48.        ## Make sure the value given was either "yes" or "no".
  49. @@ -3557,6 +3574,10 @@
  50.       echo "configure: warning: --with-cde ignored:  Not valid without X support" >&2 
  51.      with_menubars='no'
  52.    fi
  53. +  if [ "x${with_offix}" != x ]; then
  54. +     echo "configure: warning: --with-offix ignored:  Not valid without X support" >&2 
  55. +    with_offix='no'
  56. +  fi
  57.    if [ "x${with_menubars}" != x ]; then
  58.       echo "configure: warning: --with-menubars ignored:  Not valid without X support" >&2 
  59.      with_menubars='no'
  60. @@ -3574,6 +3595,7 @@
  61.      with_toolbars='no'
  62.    fi
  63.    with_cde='no'
  64. +  with_offix='no'
  65.    with_menubars='no'
  66.    with_scrollbars='no'
  67.    with_dialogs='no'
  68. @@ -4229,6 +4251,66 @@
  69.  fi
  70.  
  71.  #
  72. +# See if we can find OffiX.
  73. +#
  74. +if test "${window_system}" != "none" ; then
  75. +  if test "${with_offix}" != "no" ; then
  76. +    if test "${with_offix}" != "yes" ; then
  77. +      internal_offix_lib_found='no'
  78. +      ac_save_LIBS="${LIBS}"
  79. +LIBS="${LIBS} -lDnd"
  80. +ac_have_lib=""
  81. +test -n "$silent" || echo "checking for -lDnd"
  82. +cat > conftest.${ac_ext} <<EOF
  83. +#include "confdefs.h"
  84. +
  85. +int main() { return 0; }
  86. +int t() { main();; return 0; }
  87. +EOF
  88. +if eval $ac_compile; then
  89. +  rm -rf conftest*
  90. +  ac_have_lib="1"
  91. +
  92. +fi
  93. +rm -f conftest*
  94. +LIBS="${ac_save_LIBS}"
  95. +if test -n "${ac_have_lib}"; then
  96. +   :; internal_offix_lib_found='yes'
  97. +else
  98. +   :; 
  99. +fi
  100. +
  101. +      if test "${internal_offix_lib_found}" = "yes" ; then
  102. +        internal_offix_includes_found='no'
  103. +        for arg in ${DEFS} /usr/include
  104. +          do
  105. +            if test -f `echo "${arg}/OffiX/DragAndDrop.h" | sed 's/^\-I//'` ; then
  106. +            internal_offix_includes_found='yes'
  107. +            fi
  108. +          done
  109. +        if test "${internal_offix_includes_found}" = "yes" ; then
  110. +          with_offix='yes'
  111. +        fi
  112. +      fi
  113. +    fi
  114. +  fi
  115. +fi
  116. +if test "${with_offix}" = "yes" ; then
  117. +  
  118. +{
  119. +test -n "$verbose" && \
  120. +echo "    defining HAVE_OFFIX_DND"
  121. +echo "#define" HAVE_OFFIX_DND "1" >> confdefs.h
  122. +DEFS="$DEFS -DHAVE_OFFIX_DND=1"
  123. +ac_sed_defs="${ac_sed_defs}\${ac_dA}HAVE_OFFIX_DND\${ac_dB}HAVE_OFFIX_DND\${ac_dC}1\${ac_dD}
  124. +\${ac_uA}HAVE_OFFIX_DND\${ac_uB}HAVE_OFFIX_DND\${ac_uC}1\${ac_uD}
  125. +\${ac_eA}HAVE_OFFIX_DND\${ac_eB}HAVE_OFFIX_DND\${ac_eC}1\${ac_eD}
  126. +"
  127. +}
  128. +
  129. +fi
  130. +
  131. +#
  132.  # See if we can find Xlocale.h.
  133.  #
  134.  with_xlocale_h='no'
  135. @@ -8010,6 +8092,9 @@
  136.  fi
  137.  if [ "$with_cde" = "yes" ]; then
  138.    echo "  Compiling in support for CDE."
  139. +fi
  140. +if [ "$with_offix" = "yes" ]; then
  141. +  echo "  Compiling in support for OffiX."
  142.  fi
  143.  if [ "$with_mocklisp" = "yes" ]; then
  144.    echo "  Compiling in support for Mocklisp."
  145. diff -u --recursive orig/xemacs-19.14/configure.in xemacs-19.14/configure.in
  146. --- orig/xemacs-19.14/configure.in    Wed Jun 26 19:13:39 1996
  147. +++ xemacs-19.14/configure.in    Wed Jun 26 17:48:18 1996
  148. @@ -226,6 +226,7 @@
  149.               Motif dialog boxes will be used if Motif can be
  150.               found.)
  151.  --with-cde (*)        Compile in support for CDE drag and drop.
  152. +--with-offix (*)    Compile in support for OffiX drag and drop.
  153.  --with-xpm (*)        Compile with support for XPM files.
  154.              It is highly recommended that you obtain XPM
  155.              (version 3.4g or better) if you don't already
  156. @@ -640,6 +641,22 @@
  157.            eval "${opt}=\"${val}\""
  158.          ;;
  159.  
  160. +        ## Has the user requested OffiX support?
  161. +    "with_offix" )
  162. +      ## Make sure the value given was either "yes" or "no".
  163. +      case "${val}" in
  164. +        y | ye | yes )    val=yes ;;
  165. +        n | no )        val=no  ;;
  166. +        * )
  167. +          (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  168. +Set it to either \`yes' or \`no'."
  169. +           echo "${short_usage}") >&2
  170. +          exit 1
  171. +        ;;
  172. +      esac
  173. +          eval "${opt}=\"${val}\""
  174. +        ;;
  175. +
  176.          ## Has the user requested XPM support?
  177.      "with_xpm" )
  178.        ## Make sure the value given was either "yes" or "no".
  179. @@ -2730,6 +2747,10 @@
  180.      ] AC_WARN(--with-cde ignored:  Not valid without X support) [
  181.      with_menubars='no'
  182.    fi
  183. +  if [ "x${with_offix}" != x ]; then
  184. +    ] AC_WARN(--with-offix ignored:  Not valid without X support) [
  185. +    with_offix='no'
  186. +  fi
  187.    if [ "x${with_menubars}" != x ]; then
  188.      ] AC_WARN(--with-menubars ignored:  Not valid without X support) [
  189.      with_menubars='no'
  190. @@ -2747,6 +2768,7 @@
  191.      with_toolbars='no'
  192.    fi
  193.    with_cde='no'
  194. +  with_offix='no'
  195.    with_menubars='no'
  196.    with_scrollbars='no'
  197.    with_dialogs='no'
  198. @@ -3197,6 +3219,33 @@
  199.  fi
  200.  
  201.  #
  202. +# See if we can find OffiX.
  203. +#
  204. +if test "${window_system}" != "none" ; then
  205. +  if test "${with_offix}" != "no" ; then
  206. +    if test "${with_offix}" != "yes" ; then
  207. +      internal_offix_lib_found='no'
  208. +      AC_HAVE_LIBRARY(-lDnd, internal_offix_lib_found='yes')
  209. +      if test "${internal_offix_lib_found}" = "yes" ; then
  210. +        internal_offix_includes_found='no'
  211. +        for arg in ${DEFS} /usr/include
  212. +          do
  213. +            if test -f `echo "${arg}/OffiX/DragAndDrop.h" | sed 's/^\-I//'` ; then
  214. +            internal_offix_includes_found='yes'
  215. +            fi
  216. +          done
  217. +        if test "${internal_offix_includes_found}" = "yes" ; then
  218. +          with_offix='yes'
  219. +        fi
  220. +      fi
  221. +    fi
  222. +  fi
  223. +fi
  224. +if test "${with_offix}" = "yes" ; then
  225. +  AC_DEFINE(HAVE_OFFIX_DND)
  226. +fi
  227. +
  228. +#
  229.  # See if we can find Xlocale.h.
  230.  #
  231.  with_xlocale_h='no'
  232. @@ -4314,6 +4363,9 @@
  233.  fi
  234.  if [ "$with_cde" = "yes" ]; then
  235.    echo "  Compiling in support for CDE."
  236. +fi
  237. +if [ "$with_offix" = "yes" ]; then
  238. +  echo "  Compiling in support for OffiX."
  239.  fi
  240.  if [ "$with_mocklisp" = "yes" ]; then
  241.    echo "  Compiling in support for Mocklisp."
  242. diff -u --recursive orig/xemacs-19.14/src/Makefile.in.in xemacs-19.14/src/Makefile.in.in
  243. --- orig/xemacs-19.14/src/Makefile.in.in    Wed Jun 26 19:42:00 1996
  244. +++ xemacs-19.14/src/Makefile.in.in    Wed Jun 26 19:45:26 1996
  245. @@ -739,6 +739,12 @@
  246.  #  define LIB_CDE
  247.  #endif
  248.  
  249. +#ifdef HAVE_OFFIX_DND
  250. +#  define LIB_OFFIX_DND -lDnd
  251. +#else
  252. +#  defile LIB_OFFIX_DND
  253. +#endif
  254. +
  255.  #if (defined(LIB_INTL) && (!(defined(I18N3) || defined(I18N4))))
  256.    /* this should be defined by s- files, but we should not use it unless
  257.       I18N3 or I18N4 are defined. */
  258. @@ -1161,7 +1167,7 @@
  259.         ${lispdir}bytecomp/byte-optimize.elc \
  260.         ${lispdir}utils/advice.elc
  261.  
  262. -LIBES = NAS_LIBS SOUND_LIBS SOCKS_LIBS ENERGIZE_LIBS LIB_CDE \
  263. +LIBES = NAS_LIBS SOUND_LIBS SOCKS_LIBS ENERGIZE_LIBS LIB_CDE LIB_OFFIX_DND\
  264.      LIB_TOOLTALK $(LIBX) \
  265.      LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP LIB_INTL QUANTIFY_LIBS \
  266.      DATABASE_LIBS LIBS_DEBUG $(GNULIB_VAR) LIB_MATH LIB_STANDARD \
  267. diff -u --recursive orig/xemacs-19.14/src/config.h.in xemacs-19.14/src/config.h.in
  268. --- orig/xemacs-19.14/src/config.h.in    Wed Jun 26 19:42:34 1996
  269. +++ xemacs-19.14/src/config.h.in    Wed Jun 26 19:54:52 1996
  270. @@ -353,6 +353,10 @@
  271.  */
  272.  #undef HAVE_CDE
  273.  
  274. +/* Define this if you want to use the OffiX Drag and Drop
  275. +*/
  276. +#undef HAVE_OFFIX_DND
  277. +
  278.  /* Mocklisp Support. */
  279.  #undef MOCKLISP_SUPPORT
  280.  
  281. diff -u --recursive orig/xemacs-19.14/src/frame-x.c xemacs-19.14/src/frame-x.c
  282. --- orig/xemacs-19.14/src/frame-x.c    Wed Jun 26 17:16:34 1996
  283. +++ xemacs-19.14/src/frame-x.c    Wed Jun 26 17:17:19 1996
  284. @@ -971,6 +971,47 @@
  285.  }
  286.  #endif
  287.  
  288. +#ifdef HAVE_OFFIX_DND
  289. +#include <OffiX/DragAndDrop.h>
  290. +
  291. +void 
  292. +x_offix_drop_event_handler (Widget widget, XtPointer data, XEvent *event,                       Boolean *b)
  293. +{
  294. +  int i, len, Type;    
  295. +  unsigned char *Data;
  296. +  unsigned long Size;
  297. +
  298. +  Lisp_Object path = Qnil;
  299. +  Lisp_Object frame = Qnil;
  300. +
  301. +  struct gcpro gcpro1, gcpro2;
  302. +
  303. +  Type = DndDataType(event); 
  304. +  if((Type != DndFile) && (Type != DndFiles) && (Type != DndExe)) return;
  305. +  DndGetData(&Data, &Size);
  306. +  
  307. +  GCPRO2 (path, frame);
  308. +
  309. +  frame = make_frame ((struct frame *) data);
  310. +
  311. +  if(Type == DndFiles) {
  312. +    while(*Data) {
  313. +      len = strlen((char*)Data);
  314. +      path = make_string ((char*)Data, len);
  315. +      va_run_hook_with_args (Qdrag_and_drop_functions, 2, frame, path);
  316. +      Data += len+1; 
  317. +    }
  318. +  } else {
  319. +    path = make_string ((char*)Data, strlen(Data));    
  320. +    va_run_hook_with_args (Qdrag_and_drop_functions, 2, frame, path);
  321. +  }
  322. +
  323. +  UNGCPRO;
  324. +  return;
  325. +}
  326. +
  327. +#endif
  328. +
  329.  
  330.  /************************************************************************/
  331.  /*                widget creation                */
  332. @@ -1636,6 +1677,15 @@
  333.               dnd_transfer_cb_rec,
  334.               DtNpreserveRegistration, False,
  335.               NULL);
  336. +  }
  337. +#endif
  338. +
  339. +#ifdef HAVE_OFFIX_DND
  340. +  {
  341. +    DndInitialize(FRAME_X_SHELL_WIDGET (f));
  342. +    DndRegisterDropWidget(FRAME_X_TEXT_WIDGET (f), x_offix_drop_event_handler, 
  343. +              (XtPointer) f);
  344. +
  345.    }
  346.  #endif
  347.  
  348. diff -u --recursive orig/xemacs-19.14/src/frame.c xemacs-19.14/src/frame.c
  349. --- orig/xemacs-19.14/src/frame.c    Wed Jun 26 17:16:40 1996
  350. +++ xemacs-19.14/src/frame.c    Wed Jun 26 17:17:17 1996
  351. @@ -54,7 +54,7 @@
  352.  Lisp_Object Vmap_frame_hook, Qmap_frame_hook;
  353.  Lisp_Object Vunmap_frame_hook, Qunmap_frame_hook;
  354.  Lisp_Object Vallow_deletion_of_last_visible_frame;
  355. -#ifdef HAVE_CDE
  356. +#if defined (HAVE_CDE) || defined (HAVE_OFFIX_DND)
  357.  Lisp_Object Vdrag_and_drop_functions, Qdrag_and_drop_functions;
  358.  #endif
  359.  Lisp_Object Vmouse_motion_handler;
  360. @@ -2879,7 +2879,7 @@
  361.    defsymbol (&Qmouse_leave_frame_hook, "mouse-leave-frame-hook");
  362.    defsymbol (&Qmap_frame_hook, "map-frame-hook");
  363.    defsymbol (&Qunmap_frame_hook, "unmap-frame-hook");
  364. -#ifdef HAVE_CDE
  365. +#if defined (HAVE_CDE) || defined (HAVE_OFFIX_DND)
  366.    defsymbol (&Qdrag_and_drop_functions, "drag-and-drop-functions");
  367.  #endif
  368.  
  369. @@ -3057,7 +3057,7 @@
  370.  */ );
  371.    Vallow_deletion_of_last_visible_frame = Qnil;
  372.  
  373. -#ifdef HAVE_CDE
  374. +#if defined (HAVE_CDE) || defined (HAVE_OFFIX_DND)
  375.    DEFVAR_LISP ("drag-and-drop-functions", &Vdrag_and_drop_functions /*
  376.  Function or functions to run when an object is dropped on a frame.
  377.  Each function is called with two args, a frame and a pathname.
  378.